//管理员端修改模板评分参数接口
package xiangmu.schoolpaper.controller.system;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import xiangmu.schoolpaper.pojo.DTO.AdminUpdateTemplateScoreDTO;
import xiangmu.schoolpaper.service.system.AdminUpdateTemplateScoreService;

@RestController
@RequestMapping("/api/admin/template-score")

@Slf4j
@Tag(name = "修改模板评分参数接口")
public class AdminUpdateTemplateScoreController {

    @Autowired
    private AdminUpdateTemplateScoreService adminUpdateTemplateScoreService;

    @PostMapping("/postAdminUpdateTemplateScore")
    @Operation(summary = "修改模板评分参数接口")
    public String updateTemplateScore(@RequestBody AdminUpdateTemplateScoreDTO dto) {
        log.info("修改模板评分参数");
        int result = adminUpdateTemplateScoreService.updateTemplateScore(dto);
        if (result > 0) {
            return "模板评分参数更新成功";
        } else {
            return "模板评分参数更新失败";
        }
    }
}